package main;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import model.ConnectDB;
import view.LoginDialog;
import view.WrongConnectDialog;

public class MainWindows extends JFrame
{

    public static void main(String[] args)
    {
        try
        {
            for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
            {
                if ("Windows".equals(info.getName()))
                {
                    UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        }
        catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)
        {
        }

        if (ConnectDB.connect())
        {
            LoginDialog lDialog = new LoginDialog(null, true);
            ConnectDB.close();
        }
        else
        {
            WrongConnectDialog wcDialog = new WrongConnectDialog(null, true);
            ConnectDB.close();

        }
    }
}
